﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="QL_LoaiSanPham.ascx.cs" Inherits="Admin_UserControl_QL_LoaiSanPham" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="DevExpress.Web.v9.1" Namespace="DevExpress.Web.ASPxRoundPanel"
    TagPrefix="dxrp" %>
<%@ Register assembly="DevExpress.Web.v9.1" namespace="DevExpress.Web.ASPxPanel" tagprefix="dxp" %>
<div>
    <dxrp:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="100%" 
        BackColor="White" CssFilePath="~/App_Themes/Glass/{0}/styles.css" 
        CssPostfix="Glass">
        <HeaderStyle BackColor="White" Height="23px">
        <Paddings PaddingBottom="0px" PaddingLeft="2px" PaddingTop="0px" />
        <BorderBottom BorderStyle="None" />
<Paddings PaddingLeft="2px" PaddingTop="0px" PaddingBottom="0px"></Paddings>

<BorderBottom BorderStyle="None"></BorderBottom>
        </HeaderStyle>
        <TopLeftCorner Height="5px" Url="~/App_Themes/Glass/Web/rpTopLeftCorner.png" 
            Width="5px" />
        <NoHeaderTopLeftCorner Height="5px" 
            Url="~/App_Themes/Glass/Web/rpNoHeaderTopLeftCorner.png" Width="5px" />
        <TopRightCorner Height="5px" Url="~/App_Themes/Glass/Web/rpTopRightCorner.png" 
            Width="5px" />
        <NoHeaderTopRightCorner Height="5px" 
            Url="~/App_Themes/Glass/Web/rpNoHeaderTopRightCorner.png" Width="5px" />
        <BottomRightCorner Height="5px" 
            Url="~/App_Themes/Glass/Web/rpBottomRightCorner.png" Width="5px" />
        <BottomLeftCorner Height="5px" 
            Url="~/App_Themes/Glass/Web/rpBottomLeftCorner.png" Width="5px" />

<TopLeftCorner Height="5px" Width="5px" 
            Url="~/App_Themes/Glass/Web/rpTopLeftCorner.png"></TopLeftCorner>

<NoHeaderTopLeftCorner Height="5px" Width="5px" 
            Url="~/App_Themes/Glass/Web/rpNoHeaderTopLeftCorner.png"></NoHeaderTopLeftCorner>

<TopRightCorner Height="5px" Width="5px" 
            Url="~/App_Themes/Glass/Web/rpTopRightCorner.png"></TopRightCorner>

<NoHeaderTopRightCorner Height="5px" Width="5px" 
            Url="~/App_Themes/Glass/Web/rpNoHeaderTopRightCorner.png"></NoHeaderTopRightCorner>

<BottomRightCorner Height="5px" Width="5px" 
            Url="~/App_Themes/Glass/Web/rpBottomRightCorner.png"></BottomRightCorner>

<BottomLeftCorner Height="5px" Width="5px" 
            Url="~/App_Themes/Glass/Web/rpBottomLeftCorner.png"></BottomLeftCorner>

        <HeaderLeftEdge>
            <BackgroundImage ImageUrl="~/App_Themes/Glass/Web/rpHeaderLeftEdge.gif" 
                Repeat="RepeatX" VerticalPosition="bottom" />
<BackgroundImage ImageUrl="~/App_Themes/Glass/Web/rpHeaderLeftEdge.gif" Repeat="RepeatX" VerticalPosition="bottom"></BackgroundImage>
        </HeaderLeftEdge>
        <HeaderContent>
            <BackgroundImage ImageUrl="~/App_Themes/Glass/Web/rpHeaderBack.gif" 
                Repeat="RepeatX" VerticalPosition="bottom" />
<BackgroundImage ImageUrl="~/App_Themes/Glass/Web/rpHeaderBack.gif" Repeat="RepeatX" VerticalPosition="bottom"></BackgroundImage>
        </HeaderContent>
        <HeaderRightEdge>
            <BackgroundImage ImageUrl="~/App_Themes/Glass/Web/rpHeaderRightEdge.gif" 
                VerticalPosition="bottom" />
<BackgroundImage ImageUrl="~/App_Themes/Glass/Web/rpHeaderRightEdge.gif" VerticalPosition="bottom"></BackgroundImage>
        </HeaderRightEdge>
        <NoHeaderTopEdge BackColor="#EBF2F4">
        </NoHeaderTopEdge>
        <RightEdge>
            <BackgroundImage ImageUrl="~/App_Themes/Glass/Web/rpLeftRightEdge.gif" 
                Repeat="RepeatX" VerticalPosition="bottom" />
<BackgroundImage ImageUrl="~/App_Themes/Glass/Web/rpLeftRightEdge.gif" Repeat="RepeatX" VerticalPosition="bottom"></BackgroundImage>
        </RightEdge>
        <BottomEdge BackColor="#D7E9F1">
        </BottomEdge>
        <LeftEdge>
            <BackgroundImage ImageUrl="~/App_Themes/Glass/Web/rpLeftRightEdge.gif" 
                Repeat="RepeatX" VerticalPosition="bottom" />
<BackgroundImage ImageUrl="~/App_Themes/Glass/Web/rpLeftRightEdge.gif" Repeat="RepeatX" VerticalPosition="bottom"></BackgroundImage>
        </LeftEdge>
        <Content BackColor="White">
            <BackgroundImage Repeat="RepeatX" VerticalPosition="bottom" />
<BackgroundImage Repeat="RepeatX" VerticalPosition="bottom"></BackgroundImage>
        </Content>
        <HeaderTemplate>
            <asp:Label ID="Label1" runat="server" Text="QUẢN LÝ LOẠI SẢN PHẨM"></asp:Label>
        </HeaderTemplate>
        <PanelCollection>
<dxp:PanelContent runat="server" SupportsDisabledAttribute="True">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <fieldset>  
                <legend>Thêm loại sản phẩm</legend>              
                <asp:Label ID="Label2" runat="server" Text="Tên loại sản phẩm:"></asp:Label>
                <telerik:RadTextBox ID="txtCategoryName" runat="server" MaxLength="250" 
                    ontextchanged="txtCategoryName_TextChanged" AutoPostBack="True" 
                    Width="200px">
                </telerik:RadTextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    ErrorMessage="*" ControlToValidate="txtCategoryName" 
                    ValidationGroup="Save"></asp:RequiredFieldValidator>
                <asp:Label ID="Label3" runat="server" Text="Tên sản phẩm không dấu:"></asp:Label>
                <telerik:RadTextBox ID="txtCategoryNameNoSign" runat="server" MaxLength="250" 
                    Enabled="false" Width="200px">
                </telerik:RadTextBox><br />
                <asp:Label ID="Label4" runat="server" Text="Thuộc loại:"></asp:Label>
                <asp:DropDownList ID="ddlParentCategory" runat="server" 
                    AppendDataBoundItems="True">
                    <asp:ListItem Value="NULL" Selected>-- thuộc loại sản phẩm --</asp:ListItem>
                </asp:DropDownList>
                <telerik:RadButton ID="btnAddCategory" runat="server" Text="Lưu lại" 
                    onclick="btnAddCategory_Click" ValidationGroup="Save">
                </telerik:RadButton>
                <asp:Label ID="lblWarning" runat="server" Text="" Visible="false"></asp:Label>
            </fieldset>
            <telerik:RadGrid ID="gvCategory" runat="server" AllowAutomaticDeletes="True" 
                AllowAutomaticUpdates="True" AllowPaging="True" AutoGenerateColumns="False" 
                CellSpacing="0" DataSourceID="ods_Category" Width="400px" 
                AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True">
                <MasterTableView DataKeyNames="CategoryID" DataSourceID="ods_Category">
                    <CommandItemSettings ExportToPdfText="Export to PDF" />
                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" 
                        Visible="True">
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                        Visible="True">
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="CategoryID" DataType="System.Int32" 
                            FilterControlAltText="Filter CategoryID column" HeaderText="CategoryID" 
                            ReadOnly="True" SortExpression="CategoryID" UniqueName="CategoryID">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn DataField="CategoryName" 
                            FilterControlAltText="Filter CategoryName column" HeaderText="CategoryName" 
                            SortExpression="CategoryName" UniqueName="CategoryName">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtEditCategoryName" runat="server" AutoPostBack="True" 
                                    ontextchanged="txtEditCategoryName_TextChanged" 
                                    Text='<%# Bind("CategoryName") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="CategoryNameLabel" runat="server" 
                                    Text='<%# Eval("CategoryName") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="CategoryNameNoSign" Display="False" 
                            FilterControlAltText="Filter CategoryNameNoSign column" 
                            HeaderText="CategoryNameNoSign" SortExpression="CategoryNameNoSign" 
                            UniqueName="CategoryNameNoSign" Visible="False">
                            <EditItemTemplate>
                                <asp:TextBox ID="txtEditCategoryNameNoSign" runat="server" Enabled="False" 
                                    Text='<%# Bind("CategoryNameNoSign") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="CategoryNameNoSignLabel" runat="server" 
                                    Text='<%# Eval("CategoryNameNoSign") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
                <FilterMenu EnableImageSprites="False">
                    <WebServiceSettings>
                        <ODataSettings InitialContainerName="">
                        </ODataSettings>
                    </WebServiceSettings>
                </FilterMenu>
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                    <WebServiceSettings>
                        <ODataSettings InitialContainerName="">
                        </ODataSettings>
                    </WebServiceSettings>
                </HeaderContextMenu>
            </telerik:RadGrid>
            <asp:ObjectDataSource ID="ods_Category" runat="server" DeleteMethod="Delete" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetCategories" 
                TypeName="DaiCuongMobileTableAdapters.tbCategoriesTableAdapter" 
                UpdateMethod="Update">
                <DeleteParameters>
                    <asp:Parameter Name="Original_CategoryID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="CategoryName" Type="String" />
                    <asp:Parameter Name="CategoryNameNoSign" Type="String" />
                    <asp:Parameter Name="ParentCategoryID" Type="Int32" />
                    <asp:Parameter Name="Original_CategoryID" Type="Int32" />
                </UpdateParameters>
            </asp:ObjectDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
</dxp:PanelContent>
</PanelCollection>
        <Border BorderColor="#7EACB1" BorderStyle="Solid" BorderWidth="1px" />

<Border BorderColor="#7EACB1" BorderStyle="Solid" BorderWidth="1px"></Border>
    </dxrp:ASPxRoundPanel>
</div>